00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef _dae_solver_implementation_hpp_
00021 #define _dae_solver_implementation_hpp_
00022
00023 #include <boost/shared_ptr.hpp>
00024 #include <gridpack/math/dae_solver_interface.hpp>
00025 #include <gridpack/parallel/distributed.hpp>
00026 #include <gridpack/utilities/uncopyable.hpp>
00027 #include <gridpack/configuration/configurable.hpp>
00028
00029 namespace gridpack {
00030 namespace math {
00031
00032
00033
00034
00035 template <typename T, typename I = int>
00036 class DAESolverImplementation
00037 : public DAESolverInterface<T, I>,
00038 public parallel::Distributed,
00039 public utility::Configurable,
00040 private utility::Uncopyable
00041 {
00042 public:
00043
00044 typedef typename DAESolverInterface<T, I>::VectorType VectorType;
00045 typedef typename DAESolverInterface<T, I>::MatrixType MatrixType;
00046 typedef typename DAESolverInterface<T, I>::JacobianBuilder JacobianBuilder;
00047 typedef typename DAESolverInterface<T, I>::FunctionBuilder FunctionBuilder;
00048 typedef typename DAESolverInterface<T, I>::StepFunction StepFunction;
00049
00050
00051
00052 DAESolverImplementation(const parallel::Communicator& comm,
00053 const int local_size,
00054 JacobianBuilder& jbuilder,
00055 FunctionBuilder& fbuilder)
00056 : parallel::Distributed(comm),
00057 utility::Configurable("DAESolver"),
00058 utility::Uncopyable(),
00059 p_J(comm, local_size, local_size),
00060 p_Fbuilder(fbuilder), p_Jbuilder(jbuilder)
00061 {
00062
00063 }
00064
00065
00066
00067 ~DAESolverImplementation(void)
00068 {
00069 }
00070
00071 protected:
00072
00073
00074 MatrixType p_J;
00075
00076
00077 FunctionBuilder p_Fbuilder;
00078
00079
00080 JacobianBuilder p_Jbuilder;
00081
00082
00083 StepFunction p_preStepFunc;
00084
00085
00086 StepFunction p_postStepFunc;
00087
00088
00089 void p_configure(utility::Configuration::CursorPtr props)
00090 {}
00091
00092
00093 void p_preStep(StepFunction& f)
00094 {
00095 p_preStepFunc = f;
00096 }
00097
00098
00099 void p_postStep(StepFunction& f)
00100 {
00101 p_postStepFunc = f;
00102 }
00103
00104 };
00105
00106
00107
00108 }
00109 }
00110
00111 #endif